package com.cxhome.cxinfox.sms;

import org.apache.log4j.Logger;

import com.jfinal.plugin.activerecord.Page;
import com.traffic.managent.base.BaseService;
import com.traffic.managent.base.Paginator;
import com.traffic.managent.util.SQLUtils;

/**
 * 短信业务
 * 
 */
public class SmsService extends BaseService {

	private final static Logger log = Logger.getLogger(SmsService.class);
	public static final SmsService service = new SmsService();

	public Page<Sms> paginate(Sms model, Paginator paginate, StringBuilder orderSql) {

		SQLUtils sql = new SQLUtils(" from cx_sms where 1 = 1  ");

		if (model.getAttrValues().length != 0) {
			sql.whereLike("phoneId", model.getStr("phoneId"));
			sql.whereEquals("flag", model.getStr("flag"));
		}
		sql.append(orderSql);
		return Sms.dao.paginate(paginate, "select * ", sql.toString());

	}
}
